package com.xdk.templatescala.common.enums;

/**
 * @Author luhm
 * @Date 2021/5/7
 **/
public enum TrueFalseEnum {

    /**
     * True/false
     */
    FALSE(0,"False"),
    TRUE(1,"True");

    private Integer value;
    private String desc;

    TrueFalseEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static TrueFalseEnum get(Integer value){
        if (value == null) {
            return null;
        }
        for (TrueFalseEnum e : TrueFalseEnum.values()) {
            if (value.equals(e.value)) {
                return e;
            }
        }
        return null;
    }
    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
